package bdz.projects.inl.vo
{
	import bdz.projects.inl.core.CoreVO;

	public class HomeVO extends CoreVO
	{
		
		public var home_id:String;
		public var home_title:String;
		public var home_entry:String;
		public var home_image:String;
		public var home_active:String;
		public var home_date:Date;
		public var projects:Array = new Array();
		public var products:Array = new Array();
		
		public function HomeVO(def:XML = null) {
			idField = "home_id";
			linkPairs = [
						{tree:"projects", node:"inl_projects", arr:"projects", vo:ProjectVO},
						{tree:"products", node:"inl_products", arr:"products", vo:ProductVO}
						];	
			if(def && def.name() != "inl_home"){
				def = def.inl_home[0];	
			}
			propList = ["home_id", "home_title", "home_entry", "home_image", "home_active", "home_date"];
			super(def, null, "inl_home");
		}
		
		override protected function createPropertyAttributes():void{
			propAttributes = [
			{name:"home_title", type:"input", label:"Title"},
			{name:"home_entry", type:"text", label:"Entry"},
			{name:"home_image", type:"image", label:"Image"},
			{name:"home_active", type:"toggle", label:"Is Active"},
			{name:"home_date", type:"date", label:"Date"},
			{name:"projects", type:"dependency_list", vo:ProjectVO, label:"Projects", list:"link", labelField:"project_title", idField:"project_id"},
			{name:"products", type:"dependency_list", vo:ProductVO, label:"Products", list:"link", labelField:"product_name", idField:"product_id"}
			];
		}
		
		
	}
}